<?php
	include(ROOTPATH .'include'. DS .'protect.php');
	include(ROOTPATH .'include'. DS .'checkUserLogin.php');
	include(ROOTPATH .'class'. DS .'task.class.php');	
	include_once( ROOTPATH .'class'. DS .'mediaFile.class.php');
	
	$task = new task ;
	$mediaFile = new mediaFile ;
	
	$idCode				= getQuery('id');
	$id					= getId('id');
	
	if( $id != 0 )
		$mediaFile -> checkStatus( $id );
		
	$sql = 'SELECT * FROM `'. DB_PRE.'file` WHERE `id` = '. $id;	
	$show = $dbs -> select($sql);
	$show = $show[0];
	
	// 错误的id
	if( $id != 0  &&  count($show) == 0 )
		header('Location:'.urlRewrite('option=creatMedia'));
		
	
	
	$tag = new tag();
	
	$userInfo = $user -> getUser($show['user_id']);
	
	
	$isMy = false;
	if( $show['user_id'] == $user -> id() && $id != 0 )
		$isMy = true;
	if(!$isMy && $user -> powder() < 9  && $id != 0)
		header('Location:'.ROOT_PATH);
	
	if( $show['lock'] == '1'){//  && $user -> powder() < 9
		$isAllow = false;
		exit(infoPage('作品被锁, 不能修改','',5));
		header('Location:'.ROOT_PATH);
	}
	
	$task_id = getId('task_id');
	
	$fileTask = $dbs -> select('SELECT * FROM `'.DB_PRE.'task_attend` WHERE `file_id` = '. $id );
	if( $task_id != 0 );


?>